/**
 *
 */
package cn.hg.jfsa.manage.web;

import com.jfinal.plugin.activerecord.Page;

import java.util.List;

/**
 * 由于Layui数据表格使用的数据与JFinal的Page不一样，因此使用此类包装Page并通过renderJson()方式返回
 *
 * @author Golly
 *
 */
public class LayuiPage {

	private int code = 0;

	private String msg = "";

	private int count = 0;

	private Object data = new Object();

	public LayuiPage(List<?> list) {
		count = list.size();
		data = list;
	}

	public LayuiPage(Page<?> page) {
		count = page.getTotalRow();
		data = page.getList();
	}

	public int getCode() {
		return code;
	}

	public int getCount() {
		return count;
	}

	public Object getData() {
		return data;
	}

	public String getMsg() {
		return msg;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

}
